package com.yaoyou.dao;

import com.yaoyou.model.dataObject.PicInfo;
import com.yaoyou.model.dataObject.PicInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PicInfoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @SelectProvider(type=PicInfoSqlProvider.class, method="countByExample")
    int countByExample(PicInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @DeleteProvider(type=PicInfoSqlProvider.class, method="deleteByExample")
    int deleteByExample(PicInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Delete({
        "delete from PIC_INFO",
        "where PIC_ID = #{picId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String picId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Insert({
        "insert into PIC_INFO (PIC_ID, IMG_URL, ",
        "MEDICINE_ID)",
        "values (#{picId,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, ",
        "#{medicineId,jdbcType=VARCHAR})"
    })
    int insert(PicInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @InsertProvider(type=PicInfoSqlProvider.class, method="insertSelective")
    int insertSelective(PicInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @SelectProvider(type=PicInfoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="PIC_ID", property="picId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="IMG_URL", property="imgUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="MEDICINE_ID", property="medicineId", jdbcType=JdbcType.VARCHAR)
    })
    List<PicInfo> selectByExample(PicInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Select({
        "select",
        "PIC_ID, IMG_URL, MEDICINE_ID",
        "from PIC_INFO",
        "where PIC_ID = #{picId,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="PIC_ID", property="picId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="IMG_URL", property="imgUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="MEDICINE_ID", property="medicineId", jdbcType=JdbcType.VARCHAR)
    })
    PicInfo selectByPrimaryKey(String picId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @UpdateProvider(type=PicInfoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") PicInfo record, @Param("example") PicInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @UpdateProvider(type=PicInfoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") PicInfo record, @Param("example") PicInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @UpdateProvider(type=PicInfoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(PicInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table PIC_INFO
     *
     * @mbggenerated Thu Jul 21 13:17:01 CST 2016
     */
    @Update({
        "update PIC_INFO",
        "set IMG_URL = #{imgUrl,jdbcType=VARCHAR},",
          "MEDICINE_ID = #{medicineId,jdbcType=VARCHAR}",
        "where PIC_ID = #{picId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(PicInfo record);
}